package com.itheima.d2_buffered_stream;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class BufferedWriterTest3 {
    public static void main(String[] args) throws IOException {
        try(
                Writer fw=new FileWriter("C:\\Users\\dell\\IdeaProjects\\file-io-app\\io-app2\\src\\itheima05out.txt");
                BufferedWriter bw=new BufferedWriter(fw);
                ) {
            bw.write('a');
            bw.write('b');
            bw.write('c');
            //换行功能
            bw.newLine();
            bw.write("我爱你中国");
            bw.newLine();
            //一开始输出流是吧文件传输到缓冲区中，缓冲区输出就必须刷新流或者关闭流操作（关闭

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
